package com.hams.demo.system.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.hams.demo.common.util.Sex;

@Entity
@Table(name="t_user")
public class User {
		private Long id;
		
		private String userName;
		private Sex sex;
		private String password;
		private String telePhone;
		private Department department;
	
		@Id
		@GeneratedValue(strategy=GenerationType.IDENTITY)
		public Long getId() {
			return id;
		}
		public String getUserName() {
			return userName;
		}
		public Sex getSex() {
			return sex;
		}
		public String getPassword() {
			return password;
		}	
		public String getTelePhone() {
			return telePhone;
		}
		@ManyToOne(cascade=CascadeType.ALL)
		@JoinColumn(name="department_id")
		public Department getDepartment() {
			return department;
		}
		public void setId(Long id) {
			this.id = id;
		}
		public void setUserName(String userName) {
			this.userName = userName;
		}

		public void setSex(Sex sex) {
			this.sex = sex;
		}
		public void setPassword(String password) {
			this.password = password;
		}
		public void setTelePhone(String telePhone) {
			this.telePhone = telePhone;
		}
		public void setDepartment(Department department) {
			this.department = department;
		}
		
		
}
